<!--:include("start.html"){}  -->
<link rel="stylesheet" href="${root}assets/plugins/jquery-jsoneditor/jsoneditor.css"/>
                <div class="row">
                    <div class="col-12">
                        <div class="card">
                            <div class="card-body">
                                <h4 class="card-title">维度列表</h4>
                                <h6 class="card-subtitle"></h6>
                                <div class="m-t-40">
                                        <div class="d-flex">
                                            <div class="mr-auto">
                                                <div class="form-group">
                                                    <button id="demo-btn-addrow" data-toggle="modal" data-target="#add-contact" class="btn btn-primary btn-sm"><i class="icon wb-plus" aria-hidden="true"></i>
                                                    	新增题目
                                                    </button>
                                                    <small>新增题目</small> </div>
                                            </div>
                                            <div class="ml-auto">
                                                <div class="form-group">
                                                    <input id="demo-input-search2" type="text" placeholder="Search" autocomplete="off">
                                                </div>
                                            </div>
                                        </div>
                                </div>
<form action="save" id="form1" method="post">
<div class="form-group row">
  <label for="example-text-input" class="col-2 col-form-label">标题</label>
  <div class="col-10">
  	<input type="hidden" name="id" value="${obj.id!}" />
  	<input type="hidden" name=".table" value="cp_cm" />
  	<input type="hidden" name="opby" value="${session.admin.id!0}" >
    <input class="form-control" type="text" name="title" value="${obj.title!}" >
  </div>
</div>
<div class="form-group row">
  <label for="example-text-input" class="col-2 col-form-label">维度</label>
  <div class="col-10">
    <select class="custom-select col-12" id="inlineFormCustomSelect">
           <option selected="">请选择</option>
           <!--:for(wd in wds!){  -->
           <option value="${wd.id!}">${wd.name!}</option>
           <!--:}  -->
    </select>
  </div>
</div>
<div class="form-group row">
  <label for="example-text-input" class="col-2 col-form-label">推送</label>
  <div class="col-10">
    <div id="content" class="json-editor" ></div>
  </div>
</div>
<div class="form-group row">
  <label for="example-text-input" class="col-2 col-form-label">备注</label>
  <div class="col-10">
    <textarea name="remark" class="form-control" rows="3">${obj.remark!}</textarea>
  </div>
</div>
<div class="form-group m-b-0">
  <div class="offset-sm-3 col-sm-9">
    <button type="button" id="sub1" class="btn btn-info waves-effect waves-light m-t-10">保存</button>
    <button type="button" onclick="history.go(-1);" class="btn btn-danger waves-effect waves-light m-t-10">取消</button>
  </div>
</div>
</form>

</div>
</div>
</div>
</div>
<!--:include("end.html"){}  -->

<script src="${root}assets/plugins/jquery-jsoneditor/jquery.jsoneditor.min.js"></script>
<script>

var content=${obj.content!"\"\""};
if(content==""){
	content=[]
}
$('#content').jsonEditor(content, {
	change:function(data){
		content=data;
	}
});
    $("#sub1").click(function(){
    	var form1 =$('#form1');
        form1.append($("<input type='hidden' name='content' value='"+JSON.stringify(content)+"'/>"));// 还可以添加额外的表单数据
        form1.submit();
        return false;
});
</script>